<?php

/**
 * concert actions.
 *
 * @package    hacride
 * @subpackage concert
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class concertActions extends autoconcertActions
{
  public function executeEdit()
  {
    $this->concert = $this->getConcertOrCreate();

    if ($this->getRequest()->getMethod() != sfRequest::POST)
    {
      if ($this->getRequestParameter('tour_id'))
      {
        $this->concert->setTourId($this->getRequestParameter('tour_id'));
      }
      $this->labels = $this->getLabels();
    }
    else
    {
      $this->updateConcertFromRequest();

      $this->saveConcert($this->concert);

      $this->setFlash('notice', 'Your modifications have been saved');

      if ($this->getRequestParameter('save_and_add'))
      {
        return $this->redirect('concert/create');
      }
      else if ($this->getRequestParameter('save_and_list'))
      {
        return $this->redirect('concert/list');
      }
      else
      {
        return $this->redirect('concert/edit?id='.$this->concert->getId());
      }
    }

  }
}
